package liy.demo.wikiproject.controller;

import jakarta.annotation.Resource;
import liy.demo.wikiproject.domain.Test;
import liy.demo.wikiproject.mapper.TestMapper;
import liy.demo.wikiproject.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TestController {


    @Resource
    private TestService testService;
    @RequestMapping("/test/list")
    public List<Test> list(){
        return testService.list();

    }

    //默认配置
    @Value("${test.hello:TEST}")
    private String testHello;
    @RequestMapping("/hello")
    public String hello(){
        return testHello;
    }
}
